package com.example.yuejian21.nongfusanquan.yuejian21.model;

import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Clubbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Commentbean;
import com.example.yuejian21.nongfusanquan.yuejian21.service.ClubService;
import com.example.yuejian21.nongfusanquan.yuejian21.service.CommentService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Nongfusanquan on 2017-11-04.
 */

public class Commentmodel {
    private Retrofit retrofit;

    public Commentmodel() {
        retrofit = new Retrofit.Builder()
                .baseUrl("http://10.0.2.2/yuejian14/index.php/API/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<List<Commentbean>> getCommentlist(String p_id){
        CommentService commentService = retrofit.create(CommentService.class);
        return commentService.getCommentlist(p_id);
    }
    public Call <Commentbean> addComment(String p_id,String u_id,String content){
        CommentService commentService = retrofit.create(CommentService.class);
        return commentService.addComment(p_id,content,u_id);
    }
}
